package com.smz.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smz.dao.OrganizationDAO;
import com.smz.entity.Organization;
import com.smz.service.OrganizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class OrganizationServiceImpl extends ServiceImpl<OrganizationDAO, Organization> implements OrganizationService {

    @Autowired
    private OrganizationDAO organizationDAO;


    @Override
    public IPage<Organization> findByPage(int current,int size) {

        return organizationDAO.findByPage(new Page(current,size));
    }

    @Override
    public void addOrganization(Organization organization) {
        organizationDAO.insert(organization);
    }

    @Override
    public void modifyOrganization(Organization organization) {
        organizationDAO.updateById(organization);
    }

    @Override
    public void removeOrganization(Integer id) {
        organizationDAO.deleteById(id);
    }
}
